home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
United Public Domain Gold 2
/
United Public Domain Gold 2.iso
/
utilities
/
pu485.dms
/
pu485.adf
/
dp.bas
< prev
next >
Wrap
BASIC Source File
|
1977-12-31
|
5KB
|
202 lines
CLS :x=320:y=100:x1=320:y1=100 :s=1:vol=255:dur=1:f=500:t=1500 :o=1:sp=1
WIDTH 80
PRINT "please wait loading libraries ..."
a$="zthank you !;^;#":gosub draw
a$="#":gosub draw
'draw/ play emuator 1.05 25 apr 89 (C) 1989 Wonder-Soft.
'Written By David Browder
'Hisoft or amiga basic
a$="bm300,050;d30;r30;u30;l30;e15;f15;bl18;bd19;d10;r10;u10;l10;":gosub draw
a$="zplease press any key now .because we are finished drawing our little house;t1;l5;s0;c;d;e;f;g;s1;c;d;e;f;g;":gosub play
end
'********************************************************************
END
draw:
IF a$="" THEN RETURN
lp=1:d$=""
parser1:
IF lp>LEN (a$) THEN IF d$<>"" THEN GOSUB draw1:RETURN ELSE RETURN
IF MID$(a$,lp,1)=";"THEN lp=lp+1:GOSUB draw1
d$=d$+MID$(a$,lp,1):lp=lp+1
GOTO parser1
draw1:
IF d$=";" OR d$="" THEN RETURN
IF LEFT$ (d$,1)="b" THEN blank$="y":d$=RIGHT$(d$,LEN(d$)-1)
IF LEFT$(d$,1) ="n" THEN nu$="y": d$=RIGHT$(d$,LEN(d$)-1)
IF LEFT$(d$,1)="m" THEN GOSUB move :d$="":RETURN
IF LEFT$ (d$,1)="r" THEN GOSUB right:d$="":RETURN
IF LEFT$(d$,1)="l" THEN GOSUB left:RETURN
IF LEFT$(d$,1)="u" THEN GOSUB up:RETURN
IF LEFT$ (d$,1)="d" THEN GOSUB down: RETURN
IF LEFT$ (d$,1)="e" THEN GOSUB eeee: RETURN
IF LEFT$ (d$,1)="f" THEN GOSUB ffff: RETURN
IF LEFT$ (d$,1)="g" THEN GOSUB gggg: RETURN
IF LEFT$ (d$,1)="h" THEN GOSUB hhhh: RETURN
IF LEFT$ (d$,1)="s" THEN GOSUB size:RETURN
IF LEFT$ (d$,1)="c" THEN GOSUB colr:RETURN
IF LEFT$(d$,1)="z" THEN GOSUB talk:RETURN
IF LEFT$ (d$,1)="#" then PRINT "DRAW EMULATOR version 1.05 (c) 1989 Wonder-Soft ":RETURN
IF LEFT$ (d$,1)="a" THEN PRINT "ANGLE NOT YET SUPPORTED , SORRY " : RETURN
if left$ (d$,1)="^" then cls : return
PRINT "draw error in > ";d$:END
RETURN
move:
d$=RIGHT$(d$,LEN(d$)-1)
IF LEN (d$)<>7 THEN PRINT "DRAW ERROR IN MOVE STATEMENT";d$:END
IF MID$(d$,4,1)<>"," THEN PRINT "*** BAD X,Y in DRAW ***":END
v$=LEFT$(d$,3):x1=VAL(v$):v$=RIGHT$(d$,3):y1=VAL(v$) :x=x1:y=y1
GOSUB plot:RETURN
plot:
IF x<0 THEN x=0
IF x> 639 THEN x=639
IF y<0 THEN y=0
IF y>200 THEN y=200
IF blank$="y" THEN blank$="": x=x1:y=y1:d$="": RETURN
LINE (x,y)-(x1,y1)
IF nu$="y" THEN nu$="":x1=x:y1=y: d$="": RETURN
d$="":x=x1:y=y1
RETURN
right:
v=VAL(RIGHT$(d$,LEN(d$)-1 )):x1=x1+(v*s) :GOSUB plot
RETURN
left:
v=VAL (RIGHT$(d$,LEN(d$)-1 )):x1=x1-(v*s) :GOSUB plot
RETURN
up:
v=VAL (RIGHT$(d$,LEN(d$)-1 )):y1=y1-(v*s) :GOSUB plot
RETURN
down:
v=VAL (RIGHT$(d$,LEN(d$)-1 )):y1=y1+(v*s) :GOSUB plot
RETURN
eeee:
v=VAL (RIGHT$(d$,LEN(d$)-1 )):y1=y1-(v*s):x1=x1+(v*s):GOSUB plot
RETURN
ffff:
v=VAL (RIGHT$(d$,LEN(d$)-1 )):y1=y1+(v*s):x1=x1+(v*s):GOSUB plot
RETURN
gggg:
v=VAL (RIGHT$(d$,LEN(d$)-1 )):y1=y1+(v*s):x1=x1-(v*s):GOSUB plot
RETURN
hhhh:
v=VAL (RIGHT$(d$,LEN(d$)-1 )):y1=y1-(v*s):x1=x1-(v*s):GOSUB plot
RETURN
size:
s=VAL (RIGHT$(d$,LEN(d$)-1 )):d$=""
IF s=0 THEN s=1
RETURN
colr:
cc$=RIGHT$(d$,LEN(d$)-1):x2 =VAL (cc$)
IF x2<0 THEN x2=0
IF x2>32 THEN x2=32
COLOR x2:d$="" :cc$=""
RETURN
END
play:
IF a$="" THEN RETURN
lp=1:d$=""
loopa:
IF lp>LEN (a$) THEN IF d$<>"" THEN GOSUB play1:RETURN ELSE RETURN
IF MID$(a$,lp,1)=";"THEN lp=lp+1:GOSUB play1
d$=d$+MID$(a$,lp,1):lp=lp+1
GOTO loopa
play1:
IF LEFT$(d$,1)="v" THEN GOSUB volume:d$="":RETURN
IF LEFT$(d$,1)="p" THEN GOSUB pause:RETURN
IF LEFT$(d$,1)="l" THEN GOSUB note:RETURN
IF LEFT$(d$,1)="o" THEN GOSUB octive :RETURN
IF d$="a" THEN f=440:GOSUB music:RETURN
IF d$="b" THEN f=493 :GOSUB music:RETURN
IF d$="c" THEN f=523.25:GOSUB music:RETURN
IF d$="d" THEN f=587.33:GOSUB music:RETURN
IF d$="e" THEN f=659.26:GOSUB music:RETURN
IF d$="f" THEN f=701:GOSUB music: RETURN
IF d$="g" THEN f=783.99:GOSUB music: RETURN
IF LEFT$(d$,1)="s" THEN GOSUB speaker :RETURN
IF LEFT$(d$,1)="t" THEN GOSUB temp :RETURN
IF LEFT$(d$,1)="z" THEN GOSUB talk :RETURN
IF LEFT$(d$,1)="#" then PRINT "Play Emulator Version 1.05 (C) 1989 Wonder-Soft":RETURN
PRINT "*** play error *** > ";d$:END
RETURN
music:
SOUND f*o,dur,vol,sp
FOR tempo=1 TO t:NEXT
d$=""
RETURN
volume:
vol=VAL(RIGHT$(d$,LEN(d$)-1))
IF vol>255 THEN vol=255
IF vol<0 THEN vol =0
d$="":RETURN
pause:
delay=VAL(RIGHT$(d$,LEN(d$)-1))
FOR xza =1 TO delay*150:NEXT
d$=""
RETURN
note:
dur =VAL (RIGHT$(d$,LEN(d$)-1))
IF dur<1 THEN dur=1
IF dur>77 THEN dur=77
d$="":RETURN
octive:
o=VAL(RIGHT$(d$,LEN(d$)-1))
IF o<0 THEN o=0
IF o>12 THEN o=12
d$="":RETURN
speaker:
sp=VAL(RIGHT$(d$,LEN(d$)-1))
IF sp<0 THEN sp=0
IF sp>3 THEN sp=3
d$=""
RETURN
temp:
t=VAL(RIGHT$(d$,LEN(d$)-1))
IF t >5000 THEN t=5000
IF t <1 THEN t=1
d$=""
RETURN
talk:
z$=RIGHT$(d$,LEN(d$)-1)
SAY TRANSLATE$(z$)
d$=""
RETURN